package com.leadingsoft.pwxk.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.leadingsoft.common.converter.AbstractConverter;
import com.leadingsoft.pwxk.dto.AirPermitInfoDto;
import com.leadingsoft.pwxk.model.AirPermitInfo;

/**
 * @author: lipan 2018年5月15日
 * @description: ()
 * 
 */

@Component
public class AirPermitInfoConverter extends AbstractConverter<AirPermitInfo, AirPermitInfoDto> {

	@Autowired
	private AirQcPollutionConverter airQcPollutionConverter;
	@Autowired
	private PermitApplyMonthConverter permitApplyMonthConverter;

	@Override
	protected AirPermitInfoDto toDtoActual(AirPermitInfo model) {
		// TODO Auto-generated method stub
		AirPermitInfoDto dto = new AirPermitInfoDto();
		dto.setId(model.getId());
		dto.setDataid(model.getDataid());
		dto.setEntercontent(model.getEntercontent());
		dto.setIsmonth(model.getIsmonth());
		dto.setAirQcPollution(airQcPollutionConverter.toListDto(model.getAirQcPollution()));
		dto.setApplyMonthList(permitApplyMonthConverter.toDto(model.getApplyMonthList()));
		return dto;
	}

	public void copyProperties(AirPermitInfo model, AirPermitInfoDto dto) {
		// model.setId(dto.getId());
		// model.setDataid(dto.getDataid());
		model.setEntercontent(dto.getEntercontent());
		model.setIsmonth(dto.getIsmonth());
	}

}
